	<include file="Public/head"/>
	<include file="Public/left"/>
<style>
	/* 上传图片按钮 */
	.yi-ui-file{display:block;position:relative;cursor:pointer;overflow: hidden;float: left;}
	.yi-ui-file  .yi-file-btn{text-align:center;font-size:14px;cursor:pointer;
		line-height:30px;width: 90px;padding: 0;
	}
	.yi-ui-file   .yi-fileupload{width: 90px; height: 30px;
	    cursor: pointer;font-size: 30px;
	    outline: medium none; position: absolute;
	    filter:alpha(opacity=0);-moz-opacity:0;opacity:0;left:0px;top: 0px;
	}
	.importstore-u{overflow:hidden;}
	.hr-space-12{width:100%;display:block;margin:10px 0;margin-top:50px;border-top:1px solid #ccc;padding:0;height:1px;overflow:hidden;}
</style>	
	<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">			
		<div class="row">
			<ol class="breadcrumb">
				<li><a href="/Home/Index/index"><span class="glyphicon glyphicon-home"></span></a></li>
				<li class="active">导入家具</li>
			</ol>
		</div><!--/.row-->
		<div class="row">
			<div class="col-lg-12">
				<div class="panel panel-default">
					<div class="panel-body">
						<div class="row-fluid">
							<div class="well">
							提示：导入信息必须是小于5000条的EXCEL格式(.xls)，点击<a href="__PUBLIC__/template/data1.xls">这里</a>可以查看Excel里面的格式。以卡号为准，出现重复的不导入。</div>

						</div>
						<div class="row-fluid">
								<div class="span12  form-horizontal">
									
										<div class="control-group">
										
										<div class="controls">
												<div class="yi-ui-file col-sm-2">
													<div class="yi-file-btn btn btn-primary">上传EXCEL</div>
													<input class="yi-fileupload uploadimg" type="file" id="uploadfile" name="uploadfile" value="" />
												</div>
											
											</div>
									
										</div>
								  </div>
								
						</div>
						<div style="width:100%;display:block;clear:both"></div>
						<div class="row-fluid">
								<div class="span12  form-horizontal">
									  <div class="control-group">
										<label class="control-label"></label>
										<div class="controls">
										<div id="errormsg"></div>
										</div>
									  </div>
								
										
								  </div>
							
						</div>
					</div>
				</div>
			</div>
		</div><!--/.row-->	
		
				
			
		</div><!--/.row-->	
		
		
	</div><!--/.main-->
	
<include file="Public/footer2"/>
<script src="__PUBLIC__/js/ajaxfileupload.min.js"></script>
<script>
var SYS_UPLOAD_URL='{:U("Home/Product/importD")}';
$(function(){
		$('.uploadimg').change(function(){
			var filepath = $(this).val();
			var lastDot = filepath.lastIndexOf('.');
			var cid=$(this).attr('id');
			var suffix = filepath.substring((lastDot+1)).toLowerCase();
			var fixArr=	["xls"];
			if($.inArray(suffix,fixArr)==-1){
				alert("请选择正确文件格式xls");
				return false;
			}
			var that=$(this);
			if($.trim(filepath) != ""){
				
				$.ajaxFileUpload({
					type: "POST",
					url: SYS_UPLOAD_URL,
					secureuri:false,
					fileElementId:cid,
					dataType: "json",
					success: function(msg){
						if (msg.status == 1){
							$('#errormsg').html(msg.info);
						}else{
							alert(msg.info);
						}
					}
				});
			}
		});
})
</script>
<include file="Public/footerend"/>